.map {
  --g: 0px;

  position: relative;
  margin: 0 auto;
  width: var(--width);
  height: var(--height);
  box-sizing: border-box;
  background: rgba(0,0,0,0.7);

  &.g {
    animation: map-g-animation 0.07s ease-out 1;
  }

  & > .background {
    position: absolute;
    left: 0;
    top: 0px;
    width: 100%;
    height: 100%;

    .cell {
      fill: transparent;
      stroke-width: 1px;
      stroke: rgba(200,200,200,0.05);
    }
  }

  & > .block-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .game-ready-overlay,
  .game-pause-overlay,
  .game-over-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    opacity: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 34px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    pointer-events: none;

    &.show {
      z-index: 1001;
      opacity: 1;
      pointer-events: all;
    }

    .head {
      margin-bottom: 56px;
    }

    .menu {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      width: 100%;
      margin-top: -40px;

      .button {
        margin-top: 40px;
        width: 160px;
        height: 70px;
        font-size: 20px;
      }
    }
  }

  .game-ready-overlay {
    .menu {
      .button {
        &.start {
          background-color: rgba(147, 237, 148, 0.8);
        }
      }
    }
  }

  .game-pause-overlay {
    .menu {
      .button {
        &.resume {
          background-color: rgba(147, 237, 148, 0.8);
        }
        &.restart {
          background-color: rgba(247, 110, 100, 0.8);
        }
      }
    }
  }

  .game-over-overlay {
    .menu {
      .button {
        &.restart {
          background-color: rgba(147, 237, 148, 0.8);
        }

        &.watch-replay {
          background-color: rgba(238, 238, 150, 0.8);
        }

        &.save {
          background-color: rgba(211, 130, 251, 0.8);
        }
      }
    }
  }
}

@keyframes map-g-animation {
  0% {
    transform: translateY(0px);
  }
  40% {
    transform: translateY(var(--g));
  }
  100% {
    transform: translateY(0px);
  }
}